<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
<meta name="viewport" content="width=device-width">
<meta name="theme-color" content="#222"><meta name="generator" content="Hexo 7.3.0">

  <link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon-next.png">
  <link rel="icon" type="image/png" sizes="32x32" href="/images/favicon-32x32.ico">
  <link rel="icon" type="image/png" sizes="16x16" href="/images/favicon-16x16.ico">
  <link rel="mask-icon" href="/images/logo.svg" color="#222">

<link rel="stylesheet" href="/css/main.css">



<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css" integrity="sha256-wiz7ZSCn/btzhjKDQBms9Hx4sSeUYsDrTLg7roPstac=" crossorigin="anonymous">
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/3.1.1/animate.min.css" integrity="sha256-PR7ttpcvz8qrF57fur/yAx1qXMFJeJFiA6pSzWi0OIE=" crossorigin="anonymous">
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/fancyapps-ui/5.0.28/fancybox/fancybox.css" integrity="sha256-6cQIC71/iBIYXFK+0RHAvwmjwWzkWd+r7v/BX3/vZDc=" crossorigin="anonymous">
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/pace/1.2.4/themes/green/pace-theme-minimal.css">
  <script src="https://cdnjs.cloudflare.com/ajax/libs/pace/1.2.4/pace.min.js" integrity="sha256-gqd7YTjg/BtfqWSwsJOvndl0Bxc8gFImLEkXQT8+qj0=" crossorigin="anonymous"></script>

<script class="next-config" data-name="main" type="application/json">{"hostname":"sumumm.github.io","root":"/","images":"/images","scheme":"Gemini","darkmode":false,"version":"8.19.2","exturl":false,"sidebar":{"position":"left","display":"post","padding":18,"offset":12},"copycode":{"enable":true,"style":"mac"},"fold":{"enable":true,"height":300},"bookmark":{"enable":false,"color":"#222","save":"auto"},"mediumzoom":false,"lazyload":true,"pangu":false,"comments":{"style":"tabs","active":null,"storage":true,"lazyload":false,"nav":null},"stickytabs":false,"motion":{"enable":true,"async":true,"transition":{"menu_item":"fadeInDown","post_block":"fadeIn","post_header":"fadeInDown","post_body":"fadeInDown","coll_header":"fadeInLeft","sidebar":"fadeInUp"}},"i18n":{"placeholder":"搜索...","empty":"没有找到任何搜索结果：${query}","hits_time":"找到 ${hits} 个搜索结果（用时 ${time} 毫秒）","hits":"找到 ${hits} 个搜索结果"},"path":"/search.xml","localsearch":{"enable":true,"trigger":"auto","top_n_per_article":1,"unescape":false,"preload":false}}</script><script src="/js/config.js"></script>

    <meta name="description" content="本文主要是esp8266开发板简介与esp8266工程创建、编译和烧写运行的相关笔记，若笔记中有错误或者不合适的地方，欢迎批评指正😃。">
<meta property="og:type" content="article">
<meta property="og:title" content="LV01-01-AliOSThings-05-esp8266">
<meta property="og:url" content="https://sumumm.github.io/post/a3bc5824.html">
<meta property="og:site_name" content="苏木">
<meta property="og:description" content="本文主要是esp8266开发板简介与esp8266工程创建、编译和烧写运行的相关笔记，若笔记中有错误或者不合适的地方，欢迎批评指正😃。">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV01-01-AliOSThings-05-esp8266/img/image-20200707141942899.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV01-01-AliOSThings-05-esp8266/img/esp8266_soc.jpg">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV01-01-AliOSThings-05-esp8266/img/nodemcu_board_description.jpg">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV01-01-AliOSThings-05-esp8266/img/image-20231107223723982.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV01-01-AliOSThings-05-esp8266/img/image-20200707142021427.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV01-01-AliOSThings-05-esp8266/img/nodemcu-pin-number.jpg">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV01-01-AliOSThings-05-esp8266/img/esp8266_devkit_horizontal-001.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV01-01-AliOSThings-05-esp8266/img/image-20231111123922894.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV01-01-AliOSThings-05-esp8266/img/image-20231111124539348.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV01-01-AliOSThings-05-esp8266/img/image-20231111124700464.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV01-01-AliOSThings-05-esp8266/img/image-20231111125611643.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV01-01-AliOSThings-05-esp8266/img/image-20231111125829624.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV01-01-AliOSThings-05-esp8266/img/image-20231111131359316.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV01-01-AliOSThings-05-esp8266/img/image-20231111131431356.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV01-01-AliOSThings-05-esp8266/img/image-20231111131943194.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV01-01-AliOSThings-05-esp8266/img/image-20231111132703736.png">
<meta property="og:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV01-01-AliOSThings-05-esp8266/img/image-20200707181046030.png">
<meta property="article:published_time" content="2023-11-26T13:32:57.000Z">
<meta property="article:modified_time" content="2025-06-13T16:25:57.019Z">
<meta property="article:author" content="苏木">
<meta property="article:tag" content="LV21-天猫精灵IOT">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV01-01-AliOSThings-05-esp8266/img/image-20200707141942899.png">


<link rel="canonical" href="https://sumumm.github.io/post/a3bc5824.html">



<script class="next-config" data-name="page" type="application/json">{"sidebar":"","isHome":false,"isPost":true,"lang":"zh-CN","comments":true,"permalink":"https://sumumm.github.io/post/a3bc5824.html","path":"post/a3bc5824.html","title":"LV01-01-AliOSThings-05-esp8266"}</script>

<script class="next-config" data-name="calendar" type="application/json">""</script>
<title>LV01-01-AliOSThings-05-esp8266 | 苏木</title>
  








    <script src="/js/browser_tools_disable.js"></script>

  <noscript>
    <link rel="stylesheet" href="/css/noscript.css">
  </noscript>
<!-- hexo injector head_end start --><link rel="stylesheet" href="https://unpkg.com/hexo-next-tags-plus@latest/lib/tag_plus.css" media="defer" onload="this.media='all'"><!-- hexo injector head_end end --></head>

<body itemscope itemtype="http://schema.org/WebPage" class="use-motion">
  <div class="headband"></div>

  <main class="main">
    <div class="column">
      <header class="header" itemscope itemtype="http://schema.org/WPHeader"><div class="site-brand-container">
  <div class="site-nav-toggle">
    <div class="toggle" aria-label="切换导航栏" role="button">
        <span class="toggle-line"></span>
        <span class="toggle-line"></span>
        <span class="toggle-line"></span>
    </div>
  </div>

  <div class="site-meta">

    <a href="/" class="brand" rel="start">
      <i class="logo-line"></i>
      <p class="site-title">苏木</p>
      <i class="logo-line"></i>
    </a>
      <p class="site-subtitle" itemprop="description">我的学习之路</p>
  </div>

  <div class="site-nav-right">
    <div class="toggle popup-trigger" aria-label="搜索" role="button">
        <i class="fa fa-search fa-fw fa-lg"></i>
    </div>
  </div>
</div>



<nav class="site-nav">
  <ul class="main-menu menu"><li class="menu-item menu-item-home"><a href="/" rel="section"><i class="fa fa-home fa-fw"></i>苏木的家</a></li><li class="menu-item menu-item-categories"><a href="/categories/" rel="section"><i class="fa fa-th fa-fw"></i>分类页<span class="badge">42</span></a></li><li class="menu-item menu-item-archives"><a href="/archives/" rel="section"><i class="fa fa-archive fa-fw"></i>归档页<span class="badge">673</span></a></li><li class="menu-item menu-item-flink"><a href="/flink/" rel="section"><i class="fa fa-link fa-fw"></i>友人帐</a></li><li class="menu-item menu-item-about"><a href="/about/" rel="section"><i class="fa fa-user fa-fw"></i>关于我</a></li>
      <li class="menu-item menu-item-search">
        <a role="button" class="popup-trigger"><i class="fa fa-search fa-fw"></i>搜索
        </a>
      </li>
  </ul>
</nav>



  <div class="search-pop-overlay">
    <div class="popup search-popup"><div class="search-header">
  <span class="search-icon">
    <i class="fa fa-search"></i>
  </span>
  <div class="search-input-container">
    <input autocomplete="off" autocapitalize="off" maxlength="80"
           placeholder="搜索..." spellcheck="false"
           type="search" class="search-input">
  </div>
  <span class="popup-btn-close" role="button">
    <i class="fa fa-times-circle"></i>
  </span>
</div>
<div class="search-result-container no-result">
  <div class="search-result-icon">
    <i class="fa fa-spinner fa-pulse fa-5x"></i>
  </div>
</div>

    </div>
  </div>

</header>
        
  
  <aside class="sidebar">

    <div class="sidebar-inner sidebar-nav-active sidebar-toc-active">
      <ul class="sidebar-nav">
        <li class="sidebar-nav-toc">
          文章目录
        </li>
        <li class="sidebar-nav-overview">
          站点概览
        </li>
      </ul>

      <div class="sidebar-panel-container">
        <!--noindex-->
        <div class="post-toc-wrap sidebar-panel">
            <div class="post-toc animated"><ol class="nav"><li class="nav-item nav-level-1"><a class="nav-link" href="#%E4%B8%80%E3%80%81esp8266%E5%BC%80%E5%8F%91%E6%9D%BF%E4%BB%8B%E7%BB%8D"><span class="nav-text">一、esp8266开发板介绍</span></a><ol class="nav-child"><li class="nav-item nav-level-2"><a class="nav-link" href="#1-%E5%BC%80%E5%8F%91%E6%9D%BF%E7%AE%80%E4%BB%8B"><span class="nav-text">1. 开发板简介</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#2-ESP8266%E5%92%8CNodeMCU%EF%BC%9F"><span class="nav-text">2. ESP8266和NodeMCU？</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#3-%E4%BA%A7%E5%93%81%E7%89%B9%E6%80%A7%E4%B8%8E%E5%8F%82%E6%95%B0"><span class="nav-text">3. 产品特性与参数</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#4-%E5%BC%80%E5%8F%91%E6%9D%BF%E6%8E%A5%E5%8F%A3"><span class="nav-text">4. 开发板接口</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#4-1-%E5%BC%95%E8%84%9A%E6%A6%82%E8%BF%B0"><span class="nav-text">4.1 引脚概述</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#4-2-%E4%B8%8A%E6%8B%89%E7%94%B5%E9%98%BB-%E4%B8%8B%E6%8B%89%E7%94%B5%E9%98%BB"><span class="nav-text">4.2 上拉电阻&#x2F;下拉电阻</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#4-3-%E6%A8%A1%E6%8B%9F%E8%BE%93%E5%85%A5"><span class="nav-text">4.3 模拟输入</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#4-4-%E9%80%9A%E8%AE%AF"><span class="nav-text">4.4 通讯</span></a><ol class="nav-child"><li class="nav-item nav-level-4"><a class="nav-link" href="#4-4-1-%E4%B8%B2%E8%A1%8C%E7%AB%AF%E5%8F%A3"><span class="nav-text">4.4.1 串行端口</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#4-4-2-I2C"><span class="nav-text">4.4.2 I2C</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#4-4-3-SPI"><span class="nav-text">4.4.3 SPI</span></a></li></ol></li></ol></li></ol></li><li class="nav-item nav-level-1"><a class="nav-link" href="#%E4%BA%8C%E3%80%81%E5%88%9B%E5%BB%BAesp8266%E5%B7%A5%E7%A8%8B"><span class="nav-text">二、创建esp8266工程</span></a><ol class="nav-child"><li class="nav-item nav-level-2"><a class="nav-link" href="#1-%E5%88%9B%E5%BB%BA%E5%B7%A5%E7%A8%8B"><span class="nav-text">1. 创建工程</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#2-%E7%BC%96%E8%AF%91%E5%B7%A5%E7%A8%8B"><span class="nav-text">2. 编译工程</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#2-1-%E7%BC%96%E8%AF%91%E5%91%BD%E4%BB%A4"><span class="nav-text">2.1 编译命令</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#2-2-%E7%BC%96%E8%AF%91%E4%BF%A1%E6%81%AF%E7%AE%80%E6%9E%90"><span class="nav-text">2.2 编译信息简析</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#3-%E7%83%A7%E5%86%99%E5%88%B0%E5%BC%80%E5%8F%91%E6%9D%BF"><span class="nav-text">3. 烧写到开发板</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#3-1-%E7%83%A7%E5%86%99%E5%93%AA%E4%B8%80%E4%B8%AA%E6%96%87%E4%BB%B6%EF%BC%9F"><span class="nav-text">3.1 烧写哪一个文件？</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#3-2-%E7%83%A7%E5%86%99%E5%B7%A5%E5%85%B7"><span class="nav-text">3.2 烧写工具</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#3-3-%E7%83%A7%E5%86%99%E6%96%87%E4%BB%B6"><span class="nav-text">3.3 烧写文件</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#3-4-%E4%B8%B2%E5%8F%A3%E6%9F%A5%E7%9C%8B%E6%89%93%E5%8D%B0%E4%BF%A1%E6%81%AF"><span class="nav-text">3.4 串口查看打印信息</span></a></li></ol></li></ol></li></ol></div>
        </div>
        <!--/noindex-->

        <div class="site-overview-wrap sidebar-panel">
          <div class="site-author animated" itemprop="author" itemscope itemtype="http://schema.org/Person">
    <img class="site-author-image" itemprop="image" alt="苏木"
      src="/images/avatar.jpg">
  <p class="site-author-name" itemprop="name">苏木</p>
  <div class="site-description" itemprop="description">莫道桑榆晚，为霞尚满天</div>
</div>
<div class="site-state-wrap animated">
  <nav class="site-state">
      <div class="site-state-item site-state-posts">
        <a href="/archives/">
          <span class="site-state-item-count">673</span>
          <span class="site-state-item-name">日志</span>
        </a>
      </div>
      <div class="site-state-item site-state-categories">
          <a href="/categories/">
        <span class="site-state-item-count">42</span>
        <span class="site-state-item-name">分类</span></a>
      </div>
      <div class="site-state-item site-state-tags">
        <span class="site-state-item-count">43</span>
        <span class="site-state-item-name">标签</span>
      </div>
  </nav>
</div>
  <div class="links-of-author animated">
      <span class="links-of-author-item">
        <a href="https://github.com/sumumm" title="GitHub → https:&#x2F;&#x2F;github.com&#x2F;sumumm" rel="noopener me" target="_blank"><i class="fab fa-github fa-fw"></i>GitHub</a>
      </span>
  </div>

        </div>
      </div>
    </div>

    
  </aside>


    </div>

    <div class="main-inner post posts-expand">


  


<div class="post-block">
  
  

  <article itemscope itemtype="http://schema.org/Article" class="post-content" lang="zh-CN">
    <link itemprop="mainEntityOfPage" href="https://sumumm.github.io/post/a3bc5824.html">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/avatar.jpg">
      <meta itemprop="name" content="苏木">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="苏木">
      <meta itemprop="description" content="莫道桑榆晚，为霞尚满天">
    </span>

    <span hidden itemprop="post" itemscope itemtype="http://schema.org/CreativeWork">
      <meta itemprop="name" content="LV01-01-AliOSThings-05-esp8266 | 苏木">
      <meta itemprop="description" content="">
    </span>
      <header class="post-header">
        <h1 class="post-title" itemprop="name headline">
          LV01-01-AliOSThings-05-esp8266
        </h1>

        <div class="post-meta-container">
          <div class="post-meta">
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-calendar"></i>
      </span>
      <span class="post-meta-item-text">发表于</span>

      <time title="创建时间：2023-11-26 21:32:57" itemprop="dateCreated datePublished" datetime="2023-11-26T21:32:57+08:00">2023-11-26</time>
    </span>
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-folder"></i>
      </span>
      <span class="post-meta-item-text">分类于</span>
        <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
          <a href="/categories/%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/" itemprop="url" rel="index"><span itemprop="name">嵌入式开发</span></a>
        </span>
          ，
        <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
          <a href="/categories/%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/" itemprop="url" rel="index"><span itemprop="name">01HQ课程体系</span></a>
        </span>
          ，
        <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
          <a href="/categories/%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/" itemprop="url" rel="index"><span itemprop="name">LV21-天猫精灵IOT</span></a>
        </span>
    </span>

  
    <span class="post-meta-break"></span>
    <span class="post-meta-item" title="本文字数">
      <span class="post-meta-item-icon">
        <i class="far fa-file-word"></i>
      </span>
      <span class="post-meta-item-text">本文字数：</span>
      <span>5.7k</span>
    </span>
    <span class="post-meta-item" title="阅读时长">
      <span class="post-meta-item-icon">
        <i class="far fa-clock"></i>
      </span>
      <span class="post-meta-item-text">阅读时长 &asymp;</span>
      <span>21 分钟</span>
    </span>
</div>

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody"><p>本文主要是esp8266开发板简介与esp8266工程创建、编译和烧写运行的相关笔记，若笔记中有错误或者不合适的地方，欢迎批评指正😃。</p>
<span id="more"></span>

<!-- Photo: https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV01-01-AliOSThings-05-esp8266/img/ -->

<details class="folding-tag" blue><summary> 点击查看使用工具及版本 </summary>
              <div class='content'>
              <table>    <tr>        <td align="center" width=150px>Windows版本</td>        <td align="left">windows11</td>    </tr>    <tr>        <td align="center">Ubuntu版本</td>        <td align="left">Ubuntu22.04的64位版本</td>      </tr>    <tr>        <td align="center">VMware® Workstation 16 Pro</td>        <td align="left">16.2.3 build-19376536</td>      </tr>    <tr>        <td align="center">终端软件</td>        <td align="left">MobaXterm(Professional Edition v23.0 Build 5042 (license))</td>      </tr></table>
              </div>
            </details>

<details class="folding-tag" blue><summary> 点击查看本文参考资料 </summary>
              <div class='content'>
              <table>    <tr>        <td align="center">分类</td>        <td align="center">网址</td>        <td align="center">说明</td>    </tr>    <tr>        <td align="center" rowspan="6">官方网站</td>        <td align="left"><a href="https://cn.aliyun.com/" target="_blank">阿里云</a></td>        <td align="left">阿里云官网主页</td>    </tr>    <tr>        <td align="left"><a href="https://www.aliyun.com/product/iot/livinglink?spm=5176.28508143.J_4VYgf18xNlTAyFFbOuOQe.317.5421154acZniIL&scm=20140722.X_data-1da961ea118f5bb0e4b2._.V_1" target="_blank">阿里生活物联平台</a></td>        <td align="left">生活物联网平台(飞燕平台)主页</td>    </tr>    <tr>        <td align="left"><a href="https://iap.aligenie.com/?spm=0.7629140.0.0.2c611780Ty6tzg" target="_blank">AliGenie</a></td>        <td align="left">天猫精灵开放平台AliGenie主页</td>    </tr>    <tr>        <td align="left"><a href="https://www.aliyun.com/product/iot/iot_instc_public_cn?spm=5176.28508143.J_4VYgf18xNlTAyFFbOuOQe.81.5421154au3ocqp&scm=20140722.X_data-9349178ba84cf028806a._.V_1" target="_blank">阿里物联网平台</a></td>        <td align="left">阿里物联网平台主页</td>    </tr>    <tr>        <td align="left"><a href="https://www.bluetooth.com/zh-cn/" target="_blank">Bluetooth 技术网站</a></td>        <td align="left">蓝牙协议规范什么的可以来这里找</td>    </tr>    <tr>        <td align="left"><a href="https://www.telink-semi.com/" target="_blank">Telink</a></td>        <td align="left">Telink | Chips for a Smarter IoT (telink-semi.com)<br><a href="https://www.telink-semi.cn/" target="_blank">Telink中文官网</a></td>    </tr>    <tr>        <td align="center" rowspan="5">开发手册</td>        <td align="left"><a href="https://help.aliyun.com/zh/alios-things/" target="_blank">AliOS Things开发指南</a></td>        <td align="left">AliOS Things开发指南，这里是最新版本，可以直接从官网找到</td>    </tr>     <tr>        <td align="left"><a href="https://haas.iot.aliyun.com/aliosthings/index.html" target="_blank">AliOS Things开发指南</a></td>        <td align="left">AliOS Things应用开发指南，这里应该是3.3版本的完整开发文档</td>    </tr>    <tr>        <td align="left"><a href="https://gaic.alicdn.com/aic/h5_daily/test/aliosthings/3.0.13/index.html" target="_blank">AliOS Things开发指南(3.0)</a></td>        <td align="left">AliOS Things应用开发指南，这里应该是3.0版本的完整开发文档</td>    </tr>    <tr>        <td align="left"><a href="https://help.aliyun.com/product/123207.html?spm=a2c4g.11186623.6.540.114e60d84sF58G" target="_blank">生活物联网平台开发文档</a></td>        <td align="left">生活物联网平台（飞燕平台）开发文档<br><a href="https://help.aliyun.com/document_detail/180778.html?spm=a2c4g.123207.0.0.49556adcO5apvd" target="_blank">《设备端开发指南》</a></td>    </tr>    <tr>        <td align="left"><a href="https://doc-bot.tmall.com/docs/doc.htm?spm=0.7629140.0.0.7bf81780UN7WkQ&treeId=578&articleId=118057&docType=1" target="_blank">Wi-Fi IoT品类定义与功能开发</a></td>        <td align="left">天猫精灵IoT开放平台——Wi-Fi IoT品类定义与功能开发</td>    </tr>    <tr>        <td align="center" rowspan="3">硬件平台</td>        <td align="left"><a href="https://developer.aliyun.com/article/761644?spm=a2c6h.12873581.0.dArticle761644.1c1b589dRHgvcR&groupCode=genieaiot" target="_blank">mk3080 WiFi开发板</a></td>        <td align="left">WiFi开发板使用指南-阿里云开发者社区</td>    </tr>    <tr>        <td align="left"><a href="http://www.taichi-maker.com/homepage/esp8266-nodemcu-iot/esp8266-nodemcu-tutorial-index/" target="_blank">esp8266开发板</a></td>        <td align="left">一个教程：ESP8266-NodeMCU开发板详解-太极创客 (taichi-maker.com)</td>    </tr>    <tr>        <td align="left"><a href="https://wiki.telink-semi.cn/doc/ds/DS_TLSR8258-E_Datasheet%20for%20Telink%20BLE+IEEE802.15.4%20Multi-Standard%20Wireless%20SoC%20TLSR8258.pdf" target="_blank">TLSR8258 Datasheet</a></td>        <td align="left">Datasheet for Telink BLE + IEEE802.15.4 MultiStandard Wireless SoC TLSR8258</td>    </tr>    <tr>        <td align="center" rowspan="2">参考资料</td>        <td align="left"><a href="https://developer.aliyun.com/article/720516#" target="_blank">AliOS Things 3.0 应用开发指南</a></td>        <td align="left">这个只是一篇参考文章，里面是一些环境搭建相关的，可以参考</td>    </tr>    <tr>        <td align="left"><a href="https://info.support.huawei.com/info-finder/encyclopedia/zh/index.html" target="_blank">IP知识百科 - 华为 (huawei.com)</a></td>        <td align="left">IP的一些相关知识点</td>    </tr></table>
              </div>
            </details>

<details class="folding-tag" blue><summary> 点击查看相关文件下载 </summary>
              <div class='content'>
              <table>    <tr>        <td align="center" width=150px>分类</td>        <td align="center">网址</td>        <td align="center">说明</td>    </tr>    <tr>        <td align="left" rowspan="6">蓝牙规范相关文档</td>        <td align="left"><a href="https://www.bluetooth.com/zh-cn/specifications/specs/core-specification-5-2/" target="_blank">Core Specification 5.2</a></td>        <td align="left">核心规格 5.2，该规范定义了创建可互操作的Bluetooth 设备所需的技术。                        <br><a href="./蓝牙参考资料/Core_v5.2.pdf" target="_blank">《Core_v5.2.pdf》</a></td>      </tr>    <tr>        <td align="left"><a href="https://www.bluetooth.com/zh-cn/specifications/specs/mesh-model-1-1/" target="_blank">Mesh Model(v1.1)</a></td>        <td align="left">本Bluetooth 规范定义了模型（以及它们所需的状态和消息），这些模型用于在mesh 网络中的节点上执行基本功能，超出了Bluetooth Mesh 配置文件 规范中定义的基础模型。                        <br>本规范包括定义跨设备类型标准功能的通用模型，以及支持关键mesh 场景的模型，如照明控制、传感器、时间和场景。                        <br><a href="./蓝牙参考资料/MshMDL_v1.1.pdf" target="_blank">《MshMDL_v1.1.pdf》</a></td>      </tr>    <tr>        <td align="left"><a href="https://www.bluetooth.com/zh-cn/specifications/specs/mesh-profile-1-0-1/" target="_blank">Mesh Profile(v1.0.1)</a></td>        <td align="left">该Bluetooth 规范定义了基本要求，以实现可互操作的mesh 网络解决方案，用于Bluetooth 低能量无线技术。                        <br><a href="./蓝牙参考资料/MshPRFv1.0.1.pdf" target="_blank">《MshPRFv1.0.1.pdf》</a></td>      </tr>    <tr>        <td align="left"><a href="https://www.bluetooth.com/zh-cn/specifications/device-properties/" target="_blank">Mesh Device Properties</a></td>        <td align="left">本规范包含Bluetooth Mesh 配置文件 和Bluetooth Mesh 模型规范所要求的设备属性的定义。                        <br>但是跟之前的有些区别，我主要看的之前的版本：<a href="./蓝牙参考资料/MeshDeviceProperties_v1.2.pdf" target="_blank">《MMeshDeviceProperties_v1.2.pdf》</a></td>      </tr>    <tr>        <td align="left"><a href="https://www.bluetooth.com/specifications/gss/" target="_blank">GATT Specification Supplement</a></td>        <td align="left">GATT Specification Supplement | Bluetooth® Technology Website。                        <br>好像可以在线看：<a href="https://btprodspecificationrefs.blob.core.windows.net/gatt-specification-supplement/GATT_Specification_Supplement.pdf" target="_blank">《GATT Specification Supplement》</a></td>      </tr>     <tr>        <td align="left"><a href="https://www.bluetooth.com/specifications/assigned-numbers/" target="_blank">Assigned Numbers</a></td>        <td align="left">GATT的一些类型定义可以在这里找。</td>      </tr>    <tr>        <td align="left" rowspan="2">AliOS Things</td>        <td align="left"><a href="https://gitee.com/alios-things-admin/AliOS-Things" target="_blank">alios-things/AliOS-Things</a></td>        <td align="left">Gitee上的AliOSThings SDK源码仓库</td>      </tr>    <tr>        <td align="left"><a href="https://github.com/alibaba/AliOS-Things" target="_blank">alibaba/AliOS-Things</a></td>        <td align="left">GitHub上的AliOSThings SDK源码仓库</td>      </tr>    <tr>        <td align="left" rowspan="2">天猫精灵蓝牙Mesh协议栈</td>        <td align="left"><a href="https://github.com/alibaba-archive/genie-bt-mesh-stack" target="_blank">alibaba-archive/genie-bt-mesh-stack</a></td>        <td align="left">GitHub上的天猫精灵蓝牙Mesh协议栈源码仓库。<br>之前是在<a href="https://github.com/alibaba/genie-bt-mesh-stack"target="_blank">alibaba/genie-bt-mesh-stack</a>这个仓库。<br>写笔记的时候最新提交为<a href="https://github.com/alibaba-archive/genie-bt-mesh-stack/tree/faf523618a6a2560090fc423222b9db80984bb7a" target="_blank">faf523618a6a2560090fc423222b9db80984bb7a</a></td>      </tr>    <tr>        <td align="left"><a href="https://help.aliyun.com/document_detail/171552.html?spm=a2c4g.173310.0.0.55d6e992e8xJip" target="_blank">蓝牙Mesh设备开发指南</a></td>        <td align="left">阿里云生活服务平台开发手册——蓝牙设备开发一节中的内容</td>      </tr></table>
              </div>
            </details>

<p>我这里没有esp8266开发板，所以仅仅是根据课程做个笔记，并没有进行实操，但是其实它是跟mk3080很类似的。</p>
<h1 id="一、esp8266开发板介绍"><a href="#一、esp8266开发板介绍" class="headerlink" title="一、esp8266开发板介绍"></a><font size=3>一、esp8266开发板介绍</font></h1><h2 id="1-开发板简介"><a href="#1-开发板简介" class="headerlink" title="1. 开发板简介"></a><font size=3>1. 开发板简介</font></h2><p>esp8266 指的是一个wifi SOC 芯片。下面的开发板，学名叫nodeMcu：</p>
<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV01-01-AliOSThings-05-esp8266/img/image-20200707141942899.png" alt="image-20200707141942899" style="zoom: 33%;" />

<p>NodeMCU是一个开源的IoT物联网硬件开发板，由于它支持WIFI功能且使用方法十分类似Arduino开发板。NodeMCU尺寸与Arduino Nano类似。它并不是Arduino团队开发的，但是我们也可以使用Arduino IDE 对它进行开发。作为万物互联的IoT基础，首先物联网控制板的成本不能过高。高昂的物联网控制元件不利于项目成本控制也不利于广大创客爱好者学习和使用它。在这一点上，NodeMCU比树莓派以及Arduino家族的IoT平台等更具优势。</p>
<h2 id="2-ESP8266和NodeMCU？"><a href="#2-ESP8266和NodeMCU？" class="headerlink" title="2. ESP8266和NodeMCU？"></a><font size=3>2. ESP8266和NodeMCU？</font></h2><p>在一些的网站或资料中，有时是用ESP8266有时是用NodeMCU。那么ESP8266和NodeMCU之间具体是什么关系呢？</p>
<p><strong>ESP8266是一块芯片</strong>，如下图所示：</p>
<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV01-01-AliOSThings-05-esp8266/img/esp8266_soc.jpg" alt="img" style="zoom: 25%;" />

<p>而NodeMCU是以ESP8266为核心的开发板，如下图：</p>
<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV01-01-AliOSThings-05-esp8266/img/nodemcu_board_description.jpg" alt="img" style="zoom: 40%;" />





<p>这里有一个官网，但是开发板跟上边的图不太一样，作为参考吧：<a target="_blank" rel="noopener" href="https://www.nodemcu.com/index_cn.html#fr_54747661d775ef1a3600009e">NodeMcu – 像Arduino一样简单的开源可编程固件，还有Wifi哦！</a>。</p>
<h2 id="3-产品特性与参数"><a href="#3-产品特性与参数" class="headerlink" title="3. 产品特性与参数"></a><font size=3>3. 产品特性与参数</font></h2><p>NodeMcu是一款运行于乐鑫ESP8266芯片之中的可编程固件。它以lua语言为基础，同时提供了封装esp8266硬件操作的高级API，可以让开发者以类似于arduino的方式与底层硬件打交道，使软件开发人员轻松操作设备。同时NodeMcu还提供了时间驱动型的网络API，Nodejs风格的编程方式更是让互联网开发人员如鱼得水。</p>
<p>目前NodeMcu推出的第一代开发板名字是NodeMcu Dev Kit。ESP8266封装模块ESP12进行扩展，包括了∶</p>
<ul>
<li><p>（1）D1~D10:均可复用为GPIO，PWM，I2C，1-Wire</p>
</li>
<li><p>（2）AO:1路ADC</p>
</li>
<li><p>（3）USB供电</p>
</li>
<li><p>（4）USB转串口调试接口</p>
</li>
</ul>
<p>可用RAM为20Kbyte:目前采用512K Flash，用户可用存储空间150Kbyte。同时使用NodeMcu Flash Programmer自动烧写固件。低成本的ESP8266硬件、高度抽象NodeMcuAPI将助推众多开发者们的创造性想法，让我们的原型开发快速推进。网上挺多类型开发板的，就十来块，一般都会赠送详细的资料的。就例如下边就是我随便找的一款：</p>
<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV01-01-AliOSThings-05-esp8266/img/image-20231107223723982.png" alt="image-20231107223723982" style="zoom: 25%;" />

<p>各个引脚对应情况如下：</p>
<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV01-01-AliOSThings-05-esp8266/img/image-20200707142021427.png" alt="image-20200707142021427" style="zoom:50%;" />



<h2 id="4-开发板接口"><a href="#4-开发板接口" class="headerlink" title="4. 开发板接口"></a><font size=3>4. 开发板接口</font></h2><h3 id="4-1-引脚概述"><a href="#4-1-引脚概述" class="headerlink" title="4.1 引脚概述"></a><font size=3>4.1 引脚概述</font></h3><p>我们以下面这款开发板，简单了解一下exp8266开发板吧：</p>
<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV01-01-AliOSThings-05-esp8266/img/nodemcu-pin-number.jpg" alt="nodemcu引脚名称" style="zoom:50%;" />

<p>NodeMCU开发板的引脚名指的是开发板上印刷的文字。通常这些引脚名都是一个字符接一个数字的组合，如：D0、D1、A0… 我们会用“开发板引脚”或直接使用“引脚”来表示它们。简而言之，只要您看到GPIO这几个字母，就说明是芯片引脚，而没有GPIO这几个字母，那肯定是指开发板引脚。</p>
<p>ESP8266芯片的GPIO与开发板的引脚是连在一起的。但是GPIO与开发板引脚又是如何相互连接的呢？如下图所示：</p>
<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV01-01-AliOSThings-05-esp8266/img/esp8266_devkit_horizontal-001.png" alt="ESP8266-NodeMCU引脚功能" style="zoom:50%;" />

<p>特殊引脚情况说明：</p>
<p>（1）GPIO2引脚 在NodeMCU开发板启动时是不能连接低电平的。</p>
<p>（2）GPIO15引脚在开发板运行中一直保持低电平状态。因此请不要使用GPIO15引脚来读取开关状态或进行I2C通讯。</p>
<p>（3）GPIO0引脚在开发板运行中需要一直保持高电平状态。否则ESP8266将进入程序上传工作模式也就无法正常工作了。我们无需对GPIO0引脚进行额外操作，因为NodeMCU的内置电路可以确保GPIO0引脚在工作时连接高电平而在上传程序时连接低电平。</p>
<h3 id="4-2-上拉电阻-下拉电阻"><a href="#4-2-上拉电阻-下拉电阻" class="headerlink" title="4.2 上拉电阻&#x2F;下拉电阻"></a><font size=3>4.2 上拉电阻&#x2F;下拉电阻</font></h3><p>GPIO 0-15引脚都配有内置上拉电阻。这一点与Arduino十分类似。GPIO16 引脚配有内置下拉电阻。</p>
<h3 id="4-3-模拟输入"><a href="#4-3-模拟输入" class="headerlink" title="4.3 模拟输入"></a><font size=3>4.3 模拟输入</font></h3><p>ESP8266 只有一个模拟输入引脚（该引脚通过模拟-数字转换将引脚上的模拟电压数值转化为数字量）。此引脚可以读取的模拟电压值为 0 – 1.0V。请注意：ESP8266 芯片模拟输入引脚连接在1.0V以上电压可能损坏ESP8266芯片。</p>
<p>以上所描述的是针对ESP8266芯片的引脚。而对于NodeMCU开发板引脚，情况就不同了。NodeMCU开发板配有降压电路。我们可以用NodeMCU开发板的模拟输入引脚读取0-3.3V的模拟电压信号。这个主要还是要看开发板的电路了。</p>
<h3 id="4-4-通讯"><a href="#4-4-通讯" class="headerlink" title="4.4 通讯"></a><font size=3>4.4 通讯</font></h3><h4 id="4-4-1-串行端口"><a href="#4-4-1-串行端口" class="headerlink" title="4.4.1 串行端口"></a><font size=3>4.4.1 串行端口</font></h4><p>ESP8266有2个硬件串行端口（UART）。串行端口0（UART0）使用GPIO1和GPIO3引脚。其中GPIO1引脚是TX0，GPIO3是RX0。串行端口1（UART1）使用GPIO2和GPIO8引脚。其中GPIO2引脚是TX1，GPIO8是RX1。请注意，由于GPIO8被用于连接闪存芯片，串行端口1只能使用GPIO2来向外发送串行数据。</p>
<h4 id="4-4-2-I2C"><a href="#4-4-2-I2C" class="headerlink" title="4.4.2 I2C"></a><font size=3>4.4.2 I2C</font></h4><p>ESP8266只有软件模拟的I²C端口，没有硬件I2C端口。也就是说我们可以使用任意的两个GPIO引脚通过软件模拟来实现I2C通讯。ESP8266的数据表（datasheet）中，GPIO2标注为SDA，GPIO14标注为SCL。</p>
<h4 id="4-4-3-SPI"><a href="#4-4-3-SPI" class="headerlink" title="4.4.3 SPI"></a><font size=3>4.4.3 SPI</font></h4><p>ESP8266的SPI端口情况如下：</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">GPIO14——CLK</span><br><span class="line">GPIO12——MISO</span><br><span class="line">GPIO13——MOSI</span><br><span class="line">GPIO15——CS(SS)</span><br></pre></td></tr></table></figure>

<h1 id="二、创建esp8266工程"><a href="#二、创建esp8266工程" class="headerlink" title="二、创建esp8266工程"></a><font size=3>二、创建esp8266工程</font></h1><h2 id="1-创建工程"><a href="#1-创建工程" class="headerlink" title="1. 创建工程"></a><font size=3>1. 创建工程</font></h2><figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">aos create project -b esp8266 -t helloworld_demo helloworld_esp8266</span><br></pre></td></tr></table></figure>

<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV01-01-AliOSThings-05-esp8266/img/image-20231111123922894.png" alt="image-20231111123922894" style="zoom:50%;" />

<h2 id="2-编译工程"><a href="#2-编译工程" class="headerlink" title="2. 编译工程"></a><font size=3>2. 编译工程</font></h2><h3 id="2-1-编译命令"><a href="#2-1-编译命令" class="headerlink" title="2.1 编译命令"></a><font size=3>2.1 编译命令</font></h3><figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">aos make</span><br></pre></td></tr></table></figure>

<p>编译成功会有如下信息提示：</p>
<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV01-01-AliOSThings-05-esp8266/img/image-20231111124539348.png" alt="image-20231111124539348" style="zoom:50%;" />

<h3 id="2-2-编译信息简析"><a href="#2-2-编译信息简析" class="headerlink" title="2.2 编译信息简析"></a><font size=3>2.2 编译信息简析</font></h3><p>初次编译最开始会有如下信息打印：</p>
<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV01-01-AliOSThings-05-esp8266/img/image-20231111124700464.png" alt="image-20231111124700464" style="zoom: 33%;" />

<p>最开始的时候会检查编译工具链，如上图，发现esp8266工程的交叉编译工具链为gcc-xtensa-lx106，但是我们的系统没有安装，所以就会开始自动安装。之后才会进行整个工程的编译。</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br><span class="line">64</span><br><span class="line">65</span><br><span class="line">66</span><br><span class="line">67</span><br><span class="line">68</span><br><span class="line">69</span><br><span class="line">70</span><br><span class="line">71</span><br><span class="line">72</span><br><span class="line">73</span><br><span class="line">74</span><br><span class="line">75</span><br><span class="line">76</span><br><span class="line">77</span><br><span class="line">78</span><br><span class="line">79</span><br><span class="line">80</span><br><span class="line">81</span><br><span class="line">82</span><br><span class="line">83</span><br><span class="line">84</span><br><span class="line">85</span><br><span class="line">86</span><br><span class="line">87</span><br><span class="line">88</span><br><span class="line">89</span><br><span class="line">90</span><br><span class="line">91</span><br><span class="line">92</span><br><span class="line">93</span><br><span class="line">94</span><br><span class="line">95</span><br><span class="line">96</span><br><span class="line">97</span><br><span class="line">98</span><br><span class="line">99</span><br><span class="line">100</span><br><span class="line">101</span><br><span class="line">102</span><br><span class="line">103</span><br><span class="line">104</span><br><span class="line">105</span><br><span class="line">106</span><br><span class="line">107</span><br><span class="line">108</span><br><span class="line">109</span><br><span class="line">110</span><br><span class="line">111</span><br><span class="line">112</span><br><span class="line">113</span><br><span class="line">114</span><br><span class="line">115</span><br><span class="line">116</span><br><span class="line">117</span><br><span class="line">118</span><br><span class="line">119</span><br><span class="line">120</span><br><span class="line">121</span><br><span class="line">122</span><br><span class="line">123</span><br><span class="line">124</span><br><span class="line">125</span><br><span class="line">126</span><br><span class="line">127</span><br><span class="line">128</span><br><span class="line">129</span><br><span class="line">130</span><br><span class="line">131</span><br><span class="line">132</span><br><span class="line">133</span><br><span class="line">134</span><br><span class="line">135</span><br><span class="line">136</span><br><span class="line">137</span><br><span class="line">138</span><br><span class="line">139</span><br></pre></td><td class="code"><pre><span class="line">hk@vm:~/6AliOS/helloworld_esp8266$ aos make</span><br><span class="line">aos-cube version: 0.5.11</span><br><span class="line">Check if required tools for esp8266 exist</span><br><span class="line">Toolchain gcc-xtensa-lx106 missing, start download ...</span><br><span class="line">https://gitee.com/alios-things/gcc-xtensa-lx106-linux.git -&gt; /home/hk/AliOS-Things-SDK/build/compiler/gcc-xtensa-lx106/Linux64</span><br><span class="line">正克隆到 &#x27;gcc-xtensa-lx106&#x27;...</span><br><span class="line">remote: Enumerating objects: 1110, done.</span><br><span class="line">remote: Counting objects: 100% (1110/1110), done.</span><br><span class="line">remote: Compressing objects: 100% (712/712), done.</span><br><span class="line">remote: Total 1110 (delta 371), reused 1106 (delta 371), pack-reused 0</span><br><span class="line">接收对象中: 100% (1110/1110), 25.64 MiB | 4.57 MiB/s, 完成.</span><br><span class="line">处理 delta 中: 100% (371/371), 完成.</span><br><span class="line">检查连接... 完成。</span><br><span class="line">Download toolchain gcc-xtensa-lx106 succeed</span><br><span class="line">Parsing all components ...</span><br><span class="line"></span><br><span class="line">Build Configuration:</span><br><span class="line">====================</span><br><span class="line">App: helloworld_esp8266</span><br><span class="line">Board: esp8266</span><br><span class="line">====================</span><br><span class="line"></span><br><span class="line">Making config file for first time</span><br><span class="line"><span class="meta prompt_"># </span><span class="language-bash">检查 工程所需所有组件</span></span><br><span class="line">processing components: helloworld_esp8266 esp8266 app_adapter</span><br><span class="line">*** All Components: helloworld_esp8266 esp8266 app_adapter osal_aos mcu_esp8266 kernel_init network rhino yloop newlib_stub lwip netmgr arch_xtensa_lx106 ulog lib_rbtree vfs kv</span><br><span class="line">Build AOS Now</span><br><span class="line"><span class="meta prompt_"># </span><span class="language-bash">查找编译工具链路径</span></span><br><span class="line">TOOLCHAIN_PATH=</span><br><span class="line"><span class="meta prompt_"># </span><span class="language-bash">根据工程中不同组件，生成组件.o</span></span><br><span class="line">Compiling helloworld_esp8266</span><br><span class="line">Compiling board_esp8266</span><br><span class="line">Compiling app_adapter</span><br><span class="line">Compiling osal_aos</span><br><span class="line">Compiling mcu_esp8266</span><br><span class="line">/home/hk/AliOS-Things-SDK/platform/mcu/esp8266/hal/uart.c: In function &#x27;hal_uart_send&#x27;:</span><br><span class="line">/home/hk/AliOS-Things-SDK/platform/mcu/esp8266/hal/uart.c:24:9: warning: implicit declaration of function &#x27;uart0_write_char&#x27; [-Wimplicit-function-declaration]</span><br><span class="line">         uart0_write_char(pdata[i]);</span><br><span class="line">         ^</span><br><span class="line">/home/hk/AliOS-Things-SDK/platform/mcu/esp8266/hal/misc.c: In function &#x27;hal_reboot&#x27;:</span><br><span class="line">/home/hk/AliOS-Things-SDK/platform/mcu/esp8266/hal/misc.c:32:5: warning: implicit declaration of function &#x27;rom_i2c_writeReg&#x27; [-Wimplicit-function-declaration]</span><br><span class="line">     rom_i2c_writeReg(0x67, 4, 1, 8);</span><br><span class="line">     ^</span><br><span class="line">/home/hk/AliOS-Things-SDK/platform/mcu/esp8266/hal/misc.c: In function &#x27;hal_reboot_bank&#x27;:</span><br><span class="line">/home/hk/AliOS-Things-SDK/platform/mcu/esp8266/hal/misc.c:44:5: warning: implicit declaration of function &#x27;ota_msleep&#x27; [-Wimplicit-function-declaration]</span><br><span class="line">     ota_msleep(300);</span><br><span class="line">     ^</span><br><span class="line">/home/hk/AliOS-Things-SDK/platform/mcu/esp8266/hal/misc.c:48:9: warning: implicit declaration of function &#x27;system_upgrade_process&#x27; [-Wimplicit-function-declaration]</span><br><span class="line">         system_upgrade_process();</span><br><span class="line">         ^</span><br><span class="line">/home/hk/AliOS-Things-SDK/platform/mcu/esp8266/hal/misc.c:49:9: warning: implicit declaration of function &#x27;system_restart_in_nmi&#x27; [-Wimplicit-function-declaration]</span><br><span class="line">         system_restart_in_nmi();</span><br><span class="line">         ^</span><br><span class="line">Compiling kernel_init</span><br><span class="line">Compiling rhino</span><br><span class="line">/home/hk/AliOS-Things-SDK/platform/mcu/esp8266/hal/wifi_port.c: In function &#x27;register_wlan_mgnt_monitor_cb&#x27;:</span><br><span class="line">/home/hk/AliOS-Things-SDK/platform/mcu/esp8266/hal/wifi_port.c:733:9: warning: implicit declaration of function &#x27;wifi_set_sta_rx_probe_req&#x27; [-Wimplicit-function-declaration]</span><br><span class="line">         wifi_set_sta_rx_probe_req(esp_mgmt_filter);</span><br><span class="line">         ^</span><br><span class="line">/home/hk/AliOS-Things-SDK/platform/mcu/esp8266/hal/wifi_port.c: At top level:</span><br><span class="line">/home/hk/AliOS-Things-SDK/platform/mcu/esp8266/hal/wifi_port.c:801:5: warning: initialization from incompatible pointer type [enabled by default]</span><br><span class="line">     .get_wireless_info   = get_wireless_info,</span><br><span class="line">     ^</span><br><span class="line">/home/hk/AliOS-Things-SDK/platform/mcu/esp8266/hal/wifi_port.c:801:5: warning: (near initialization for &#x27;aos_wifi_esp8266.get_wireless_info&#x27;) [enabled by default]</span><br><span class="line">Compiling yloop</span><br><span class="line">Compiling newlib_stub</span><br><span class="line">Compiling netmgr</span><br><span class="line">Compiling arch_xtensa_lx106</span><br><span class="line">Compiling ulog</span><br><span class="line">Compiling lib_rbtree</span><br><span class="line">Compiling vfs</span><br><span class="line">Compiling kv</span><br><span class="line">Making /home/hk/6AliOS/helloworld_esp8266/out/helloworld_esp8266@esp8266/ld/eagle.app.v6.new.1024.app1.ld</span><br><span class="line"><span class="meta prompt_"># </span><span class="language-bash">根据工程中不同组件，生成组件.a 静态库</span></span><br><span class="line">Making /home/hk/6AliOS/helloworld_esp8266/out/helloworld_esp8266@esp8266/libraries/helloworld_esp8266.a</span><br><span class="line">Making /home/hk/6AliOS/helloworld_esp8266/out/helloworld_esp8266@esp8266/libraries/board_esp8266.a</span><br><span class="line">Making /home/hk/6AliOS/helloworld_esp8266/out/helloworld_esp8266@esp8266/libraries/osal_aos.a</span><br><span class="line">Making /home/hk/6AliOS/helloworld_esp8266/out/helloworld_esp8266@esp8266/libraries/app_adapter.a</span><br><span class="line">Making /home/hk/6AliOS/helloworld_esp8266/out/helloworld_esp8266@esp8266/libraries/mcu_esp8266.a</span><br><span class="line">Making /home/hk/6AliOS/helloworld_esp8266/out/helloworld_esp8266@esp8266/libraries/kernel_init.a</span><br><span class="line">Making /home/hk/6AliOS/helloworld_esp8266/out/helloworld_esp8266@esp8266/libraries/rhino.a</span><br><span class="line">Making /home/hk/6AliOS/helloworld_esp8266/out/helloworld_esp8266@esp8266/libraries/yloop.a</span><br><span class="line">Making /home/hk/6AliOS/helloworld_esp8266/out/helloworld_esp8266@esp8266/libraries/newlib_stub.a</span><br><span class="line">Making /home/hk/6AliOS/helloworld_esp8266/out/helloworld_esp8266@esp8266/libraries/netmgr.a</span><br><span class="line">Making /home/hk/6AliOS/helloworld_esp8266/out/helloworld_esp8266@esp8266/libraries/arch_xtensa_lx106.a</span><br><span class="line">Making /home/hk/6AliOS/helloworld_esp8266/out/helloworld_esp8266@esp8266/libraries/ulog.a</span><br><span class="line">Making /home/hk/6AliOS/helloworld_esp8266/out/helloworld_esp8266@esp8266/libraries/lib_rbtree.a</span><br><span class="line">Making /home/hk/6AliOS/helloworld_esp8266/out/helloworld_esp8266@esp8266/libraries/vfs.a</span><br><span class="line">Making /home/hk/6AliOS/helloworld_esp8266/out/helloworld_esp8266@esp8266/libraries/kv.a</span><br><span class="line"><span class="meta prompt_"></span></span><br><span class="line"><span class="meta prompt_"># </span><span class="language-bash">生成bin文件和其他可执行文件</span></span><br><span class="line">Making helloworld_esp8266@esp8266.elf</span><br><span class="line"></span><br><span class="line">Making helloworld_esp8266@esp8266.hex</span><br><span class="line">Making helloworld_esp8266@esp8266.bin</span><br><span class="line"></span><br><span class="line">                        AOS MEMORY MAP                            </span><br><span class="line">|=================================================================|</span><br><span class="line">| MODULE                                   | ROM       | RAM      |</span><br><span class="line">|=================================================================|</span><br><span class="line">| app_adapter                              | 76        | 12       |</span><br><span class="line">| arch_xtensa_lx106                        | 2662      | 2784     |</span><br><span class="line">| board_esp8266                            | 1326      | 44       |</span><br><span class="line">| helloworld_esp8266                       | 98        | 0        |</span><br><span class="line">| kernel_init                              | 112       | 0        |</span><br><span class="line">| kv                                       | 2224      | 24       |</span><br><span class="line">| libcirom                                 | 27509     | 1200     |</span><br><span class="line">| libcrypto                                | 14512     | 0        |</span><br><span class="line">| libgcc                                   | 2167      | 0        |</span><br><span class="line">| libhal                                   | 37        | 0        |</span><br><span class="line">| liblwip                                  | 30717     | 1596     |</span><br><span class="line">| libmain                                  | 30412     | 708      |</span><br><span class="line">| libnet80211                              | 42675     | 3213     |</span><br><span class="line">| libphy                                   | 48158     | 461      |</span><br><span class="line">| libpp                                    | 43992     | 18013    |</span><br><span class="line">| libwpa                                   | 17240     | 626      |</span><br><span class="line">| mcu_esp8266                              | 8162      | 559      |</span><br><span class="line">| netmgr                                   | 94        | 8        |</span><br><span class="line">| newlib_stub                              | 363       | 0        |</span><br><span class="line">| osal_aos                                 | 670       | 0        |</span><br><span class="line">| rhino                                    | 11733     | 3288     |</span><br><span class="line">| ulog                                     | 573       | 7        |</span><br><span class="line">| vfs                                      | 1440      | 1113     |</span><br><span class="line">| yloop                                    | 2000      | 32       |</span><br><span class="line">| *fill*                                   | 2072      | 124      |</span><br><span class="line">|=================================================================|</span><br><span class="line">| TOTAL (bytes)                            | 291024    | 33812    |</span><br><span class="line">|=================================================================|</span><br><span class="line">Generate standard flash images /home/hk/6AliOS/helloworld_esp8266/out/helloworld_esp8266@esp8266/binary/helloworld_esp8266@esp8266.elf</span><br><span class="line">bin crc: 1aea8349</span><br><span class="line">Generate Raw OTA image: /home/hk/6AliOS/helloworld_esp8266/out/helloworld_esp8266@esp8266/binary/helloworld_esp8266@esp8266_ota.bin ...</span><br><span class="line">Generate Compressed OTA image: /home/hk/6AliOS/helloworld_esp8266/out/helloworld_esp8266@esp8266/binary/helloworld_esp8266@esp8266_ota.bin.xz ...</span><br><span class="line">293396</span><br><span class="line">db30897183ee121f3d671142f811b420</span><br><span class="line">195860</span><br><span class="line">e34c3d7bddf89523beab64e81ef38398</span><br><span class="line"><span class="meta prompt_"># </span><span class="language-bash">完成编译</span></span><br><span class="line">Build complete: helloworld_esp8266@esp8266</span><br><span class="line"></span><br></pre></td></tr></table></figure>

<p><strong>注意</strong>： esp8266 没有编译bootloader文件，mk3080却进行了编译并得到了成果物（不过我们似乎并不需要重新烧写bootloader）。为什么？这是因为esp8266厂家的bootloader不开源，他们提供boot.bin文件，我们直接拿来烧写就可以了，mk3080的是开源的，我们可以自己编译。</p>
<h2 id="3-烧写到开发板"><a href="#3-烧写到开发板" class="headerlink" title="3. 烧写到开发板"></a><font size=3>3. 烧写到开发板</font></h2><h3 id="3-1-烧写哪一个文件？"><a href="#3-1-烧写哪一个文件？" class="headerlink" title="3.1 烧写哪一个文件？"></a><font size=3>3.1 烧写哪一个文件？</font></h3><img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV01-01-AliOSThings-05-esp8266/img/image-20231111125611643.png" alt="image-20231111125611643" style="zoom:50%;" />

<p>还是烧写这个bin文件，只是对于esp8266来说，我们还需要两外一个文件，它在 AliOS-Things-SDK&#x2F;platform&#x2F;mcu&#x2F;esp8266&#x2F;bsp 目录下：</p>
<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV01-01-AliOSThings-05-esp8266/img/image-20231111125829624.png" alt="image-20231111125829624" style="zoom:50%;" />

<p>这个是bootloader程序的bin文件，烧写的时候要用，名字中的921600表示波特率，意思就是这个boot程序会初始化串口，串口的波特率为921600，烧写的时候波特率记得对应。</p>
<h3 id="3-2-烧写工具"><a href="#3-2-烧写工具" class="headerlink" title="3.2 烧写工具"></a><font size=3>3.2 烧写工具</font></h3><p>我们使用的是flash_download_tools。我们可以去乐鑫的官网下：<a target="_blank" rel="noopener" href="https://www.espressif.com.cn/zh-hans/support/download/other-tools">工具｜乐鑫科技 (espressif.com.cn)</a>：</p>
<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV01-01-AliOSThings-05-esp8266/img/image-20231111131359316.png" alt="image-20231111131359316" style="zoom: 25%;" />

<p>下载解压后我们会得到以下文件：</p>
<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV01-01-AliOSThings-05-esp8266/img/image-20231111131431356.png" alt="image-20231111131431356" style="zoom: 40%;" />

<p>我们打开后界面如下：</p>
<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV01-01-AliOSThings-05-esp8266/img/image-20231111131943194.png" alt="image-20231111131943194" style="zoom:50%;" />

<p>会首先弹出框①，然后我们选择这个DownloadTool之后就会弹出框②，这个框②就是下载界面。</p>
<h3 id="3-3-烧写文件"><a href="#3-3-烧写文件" class="headerlink" title="3.3 烧写文件"></a><font size=3>3.3 烧写文件</font></h3><p>我们得到上边的两个bin文件后，在烧写工具做如下配置：</p>
<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV01-01-AliOSThings-05-esp8266/img/image-20231111132703736.png" alt="image-20231111132703736" style="zoom: 50%;" />

<p>波特率为bootloader初始化串口的波特率，然后我我们点击啊START等下载完成就好了</p>
<h3 id="3-4-串口查看打印信息"><a href="#3-4-串口查看打印信息" class="headerlink" title="3.4 串口查看打印信息"></a><font size=3>3.4 串口查看打印信息</font></h3><p>烧写完成后，我们还是使用MobaXterm连接对应的串口，然后复位开发板，就看到以下打印信息说明我们烧写成功：</p>
<img data-src="https://fanhua-picture.oss-cn-hangzhou.aliyuncs.com/01%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/LV01-01-AliOSThings-05-esp8266/img/image-20200707181046030.png" alt="image-20200707181046030" style="zoom:33%;" />

    </div>

    
    
    

    <footer class="post-footer">




    <div>
        
            <div style="text-align:center;color: #ccc;font-size:14px;">
            ----------本文结束
            <i class="fas fa-fan fa-spin" style="color: #FF1493; font-size: 1rem"></i>
            感谢您的阅读----------
            </div>
        
    </div>





  
  <div class="my_post_copyright"> 
    <p><span>文章标题:</span><a href="/post/a3bc5824.html">LV01-01-AliOSThings-05-esp8266</a></p>
    <p><span>文章作者:</span><a href="/" title="欢迎访问 《苏木》 的学习笔记">苏木</a></p>
    <p><span>发布时间:</span>2023年11月26日 - 21:32</p>
    <p><span>最后更新:</span>2025年06月14日 - 00:25</p>
    <p><span>原始链接:</span><a href="/post/a3bc5824.html" title="LV01-01-AliOSThings-05-esp8266">https://sumumm.github.io/post/a3bc5824.html</a></p>
    <p><span>许可协议:</span><i class="fab fa-creative-commons"></i> <a rel="license" href= "https://creativecommons.org/licenses/by-nc-nd/4.0/" target="_blank" title="Attribution-NonCommercial-NoDerivatives 4.0 International (CC BY-NC-ND 4.0)">署名-非商业性使用-禁止演绎 4.0 国际</a> 转载请保留原文链接及作者。</p>  
  </div>
  


          <div class="post-tags">
              <a href="/tags/LV21-%E5%A4%A9%E7%8C%AB%E7%B2%BE%E7%81%B5IOT/" rel="tag"><i class="fa fa-tag"></i> LV21-天猫精灵IOT</a>
          </div>

        

          <div class="post-nav">
            <div class="post-nav-item">
                <a href="/post/92f8d106.html" rel="prev" title="LV01-01-AliOSThings-06-HelloWorld工程目录">
                  <i class="fa fa-angle-left"></i> LV01-01-AliOSThings-06-HelloWorld工程目录
                </a>
            </div>
            <div class="post-nav-item">
                <a href="/post/eb659516.html" rel="next" title="LV01-01-AliOSThings-04-mk3080">
                  LV01-01-AliOSThings-04-mk3080 <i class="fa fa-angle-right"></i>
                </a>
            </div>
          </div>
    </footer>
  </article>
</div>






</div>
  </main>

  <footer class="footer">
    <div class="footer-inner">

  <div class="copyright">
    &copy; 2017 – 
    <span itemprop="copyrightYear">2025</span>
    <span class="with-love">
      <i class="fa fa-heart"></i>
    </span>
    <span class="author" itemprop="copyrightHolder">苏木</span>
  </div>
<div class="wordcount">
  <span class="post-meta-item">
    <span class="post-meta-item-icon">
      <i class="fa fa-chart-line"></i>
    </span>
      <span>站点总字数：</span>
    <span title="站点总字数">3.7m</span>
  </span>
  <span class="post-meta-item">
    <span class="post-meta-item-icon">
      <i class="fa fa-coffee"></i>
    </span>
      <span>站点阅读时长 &asymp;</span>
    <span title="站点阅读时长">225:26</span>
  </span>
</div>




    <span id="sitetime"></span>
    <script defer language=javascript>
        function siteTime()
        {
            window.setTimeout("siteTime()", 1000);
            var seconds = 1000;
            var minutes = seconds * 60;
            var hours = minutes * 60;
            var days = hours * 24;
            var years = days * 365;
            var today = new Date();
            var todayYear = today.getFullYear();
            var todayMonth = today.getMonth()+1;
            var todayDate = today.getDate();
            var todayHour = today.getHours();
            var todayMinute = today.getMinutes();
            var todaySecond = today.getSeconds();
            /*==================================================
            Date.UTC() -- 返回date对象距世界标准时间(UTC)1970年1月1日午夜之间的毫秒数(时间戳)
            year        - 作为date对象的年份，为4位年份值
            month       - 0-11之间的整数，做为date对象的月份
            day         - 1-31之间的整数，做为date对象的天数
            hours       - 0(午夜24点)-23之间的整数，做为date对象的小时数
            minutes     - 0-59之间的整数，做为date对象的分钟数
            seconds     - 0-59之间的整数，做为date对象的秒数
            microseconds - 0-999之间的整数，做为date对象的毫秒数
            ==================================================*/
            var t1 = Date.UTC(2017, 
                              5, 
                              19, 
                              0, 
                              0, 
                              0); //北京时间
            var t2 = Date.UTC(todayYear,todayMonth,todayDate,todayHour,todayMinute,todaySecond);
            var diff = t2-t1;
            var diffYears = Math.floor(diff/years);
            var diffDays = Math.floor((diff/days)-diffYears*365);
            var diffHours = Math.floor((diff-(diffYears*365+diffDays)*days)/hours);
            var diffMinutes = Math.floor((diff-(diffYears*365+diffDays)*days-diffHours*hours)/minutes);
            var diffSeconds = Math.floor((diff-(diffYears*365+diffDays)*days-diffHours*hours-diffMinutes*minutes)/seconds);
            document.getElementById("sitetime").innerHTML="已在这里 "+diffYears+" 年 "+diffDays+" 天 "+diffHours+" 小时 "+diffMinutes+" 分钟 "+diffSeconds+" 秒";
        }
        siteTime();
    </script>



    </div>
  </footer>

  
  <div class="back-to-top" role="button" aria-label="返回顶部">
    <i class="fa fa-arrow-up fa-lg"></i>
    <span>0%</span>
  </div>
  <div class="reading-progress-bar"></div>

<noscript>
  <div class="noscript-warning">Theme NexT works best with JavaScript enabled</div>
</noscript>


  
  <script src="https://cdnjs.cloudflare.com/ajax/libs/animejs/3.2.1/anime.min.js" integrity="sha256-XL2inqUJaslATFnHdJOi9GfQ60on8Wx1C2H8DYiN1xY=" crossorigin="anonymous"></script>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/next-theme-pjax/0.6.0/pjax.min.js" integrity="sha256-vxLn1tSKWD4dqbMRyv940UYw4sXgMtYcK6reefzZrao=" crossorigin="anonymous"></script>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/fancyapps-ui/5.0.28/fancybox/fancybox.umd.js" integrity="sha256-ytMJGN3toR+a84u7g7NuHm91VIR06Q41kMWDr2pq7Zo=" crossorigin="anonymous"></script>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/lozad.js/1.16.0/lozad.min.js" integrity="sha256-mOFREFhqmHeQbXpK2lp4nA3qooVgACfh88fpJftLBbc=" crossorigin="anonymous"></script>
<script src="/js/comments.js"></script><script src="/js/utils.js"></script><script src="/js/motion.js"></script><script src="/js/next-boot.js"></script><script src="/js/pjax.js"></script>

  <script src="https://cdnjs.cloudflare.com/ajax/libs/hexo-generator-searchdb/1.4.1/search.js" integrity="sha256-1kfA5uHPf65M5cphT2dvymhkuyHPQp5A53EGZOnOLmc=" crossorigin="anonymous"></script>
<script src="/js/third-party/search/local-search.js"></script>




  <script src="/js/third-party/fancybox.js"></script>

  <script src="/js/third-party/pace.js"></script>


  




  

  <script class="next-config" data-name="enableMath" type="application/json">true</script><script class="next-config" data-name="mathjax" type="application/json">{"enable":true,"tags":"none","js":{"url":"https://cdnjs.cloudflare.com/ajax/libs/mathjax/3.2.2/es5/tex-mml-chtml.js","integrity":"sha256-MASABpB4tYktI2Oitl4t+78w/lyA+D7b/s9GEP0JOGI="}}</script>
<script src="/js/third-party/math/mathjax.js"></script>


 
        <div id="click-show-text"
            data-mobile = false
            data-text = 富强,民主,文明,和谐,自由,平等,公正,法制,爱国,敬业,诚信,友善
            data-fontsize = 15px
            data-random= false>
        </div>
       

      
        <script async src=https://cdn.jsdelivr.net/npm/hexo-next-mouse-effect@latest/click/showText.js></script>
      

      
    




    <script async src="/js/fancybox_param.js"></script>





<!-- APlayer本体 -->



</body>
</html>
